import axios, { AxiosResponse } from 'axios';
interface AppAuthLoginRespVO {
    userId: number;
    accessToken: string;
    refreshToken: string;
    expiresTime: string; // 可以根据需要转换为Date或使用Date类型
    openid?: string;
  }
interface AppMemberUserRechargeReqVO {
    id: number;      // 用户ID
    amount: number;  // 充值金额(单位：分)
}
interface AppMemberUserChangePasswordReqVO {
  userId: number;         // 用户ID
  currentPassword: string; // 当前密码
  password: string;     // 新密码
}
export const getUsers = {
 // 用户信息查询
  getUsersApi: async (authData: AppAuthLoginRespVO): Promise<AxiosResponse> => {
    return await axios.post('http://localhost:48080/app-api/member/user/get', authData);
  },
  // 账户充值
  rechargeApi: async (rechargeData: AppMemberUserRechargeReqVO): Promise<AxiosResponse<boolean>> => {
    return await axios.post('http://localhost:48080/app-api/member/user/recharge', rechargeData);
  },
   // 账户
   dchargeApi: async (rechargeData: AppMemberUserRechargeReqVO): Promise<AxiosResponse<boolean>> => {
    return await axios.post('http://localhost:48080/app-api/member/user/dcharge', rechargeData);
  },
  // 新增：修改密码API
  changePasswordApi: async (passwordData: AppMemberUserChangePasswordReqVO): Promise<AxiosResponse<boolean>> => {
    return await axios.post('http://localhost:48080/app-api/member/user/update-password', passwordData);
  }
}
